<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<div class="container-fluid">
	<div class="tabbable" id="tabs-598782">
		<ul class="nav nav-tabs">
			<li class="active"><a href="" data-toggle="tab" id="ys_project">预审的活动</a></li>
			<li><a href="" data-toggle="tab" id="wj_project">进行中的活动</a></li>
			<li><a href="" data-toggle="tab" id="sb_project">关闭的活动</a></li>
		</ul>
		<div class="tab-pane active" id="projectList">

		</div>
	</div>
</div>
<script type="text/html" id="ys-project-template">
<table class="table table-striped table-hover table-bordered">
	<thead>
		<tr>
			<th width="2%">id</th>
			<th width="18%">活动名</th>
			<th width="10%">活动状态</th>
			<th width="10%">活动分类</th>
			<th width="10%">发起日期</th>
			<th width="10%">发起人</th>
			<th width="10%">操作</th>
		</tr>
	</thead>
	<tbody>
		<$for(var i = 0;i <result.length;i++){$>
		<tr>
			<td><$=result[i].id$></td>
			<td><$=result[i].name$></td>
			<td class="status">
				<$
					switch(result[i].status){  
				case 0: 
				$>预审
				<$	
					break;
				case 1:
				$>进行中
				<$	
					break;
				case 2:
				$>关闭
				<$	
					break;
				
				default:
				$>获取活动状态失败...
				<$}$>
			</td>
			<td ><$=result[i].projectCategory.categoryName$></td>
			<td><$=result[i].createdDate$></td>
			<td><$=result[i].user.name$></td>
			<td>
				<div class="btn-group">
					<a href="${ctx}/${admin_url}/manage/preferential/edit?pid=<$=result[i].id$>"
						class="btn btn-warning"><i class="icon-cog"></i></a> 
					<$ if ( result[i].status == 0 ) { $>
					<a  href="${ctx}/project/preferential/preview?id=<$=result[i].id$>"
						class="btn btn-warning" target="_blank"><i class="icon-eye-open" ></i> </a>
					<$}else{$>
					<a  href="${ctx}/project/preferential/detail?id=<$=result[i].id$>"
						class="btn btn-warning" target="_blank"><i class="icon-eye-open" ></i> </a>
					<$ } $>
					<a href="${ctx}/${admin_url}/sendmessage?uid=<$=result[i].user.id$>" class="btn btn-warning"><i class="icon-envelope" data=<$=result[i].user.id$>></i> </a>
					<a href="${ctx}/${admin_url}/manage/preferential?pid=<$=result[i].id$>"
						class="btn btn-warning"><i class="icon-edit"></i></a>
				</div>
			</td>
		</tr>
		<$}$> 
	</tbody>
</table>
<$ if ( totalPages > 1 ) { $>
	<div class="pagination">
		<$==pagination$>
	</div>
<$ } $>
</script>
<c:if test="${env == 'production' }">
	<script type="text/javascript">
		seajs.use("${ctx}/assets/js-dist/admin/preferential-list-page");
	</script>
</c:if>
<c:if test="${env != 'production' }">
	<script type="text/javascript">
		seajs.use("${ctx}/assets/js/admin/preferential-list-page");
	</script>
</c:if>